var mySwiper = new Swiper ('.banner-swiper', {
    loop: true, // 循环模式选项
    
    // 如果需要分页器
    pagination: {
      el: '.banner-swiper .swiper-pagination',
      clickable: true,
      renderBullet: function (index, className) {
          return '<span class="' + className + '"></span>';
        }
      },
    //轮播图打开
    autoplay: {
        delay: 2500,
        disableOnInteraction: false,
    },
    
    // 如果需要前进后退按钮
    navigation: {
      nextEl: '.banner-swiper .swiper-button-next',
      prevEl: '.banner-swiper .swiper-button-prev',
    },

  });
  //header的左边栏目
$('.header-left').children('a').hover(function(){
        
    $(this).css('color','#fff')
},function(){
    $(this).css('color','#b0b0b0')
  })
  $('.header-left').find('.on').hover(function(){
    $(".header-left img").stop().slideDown()
  },function(){
    $(".header-left img").stop().slideUp()
  })
//header的中间栏目
//header的右边栏目
$('.header-right').hover(function(){
    $(this)
    .addClass('caron')
    .children('a')
    .css('color','orange')

},function(){
    $(this).removeClass('caron')
    .children('a')
    .css('color','#b0b0b0')
})
//banner的 左边效果
$('.banner-left li').hover(function(){
    $(this).addClass('banner-on').siblings().removeClass('banner-on')
    $(".banner-right").show();
},function(){
    $(this).removeClass('banner-on')
    $(".banner-right").hide();
})
// $('.banner-left li').mouseover(function(){
//     $(this).addClass("active").siblings().removeClass("active")
    
// })
//倒计时秒杀
var hour = document.getElementsByClassName("hour")[0];
var minute = document.getElementsByClassName("minute")[0];
var second = document.getElementsByClassName("second")[0];

function showHourInfo(time) {
  if (time instanceof Date) {
    var now = new Date();  //获取现在的时间
    var nowMS = now.getTime();//将现在的时间转化为毫秒形式
    var endMS = Date.parse(time);//将自己定义的时间点转换为毫秒
    var MS = endMS - nowMS;
    hour.textContent = Math.floor(MS / 1000 / 60 / 60);
    var minutetime= Math.floor((MS / 1000 / 60) % 60);
    if(minutetime<10){
      minutetime='0'+minutetime;
    }else{
      minutetime
    }
    minute.innerHTML = minutetime;
    var secondtime = Math.floor((MS / 1000) % 60);
    if(secondtime<10){
      secondtime='0'+secondtime;
    }else{
      secondtime
    }
    second.innerHTML = secondtime;
  }
}
 window.setInterval('showHourInfo(new Date(2021, 7, 20, 18, 30, 0))', 1000);
 //秒杀模块框
 var msSwiper = new Swiper ('.ms-swiper', {
  loop: false, // 循环模式选项
  // 如果需要前进后退按钮
  navigation: {
    nextEl: '.ms-swiper .swiper-button-next',
    prevEl: '.ms-swiper .swiper-button-prev',
  },
});


